public class demo2 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1=new Thread(()->{
            System.out.println("A");
        });
        Thread thread2=new Thread(()->{
            System.out.println("B");
        });
        Thread thread3=new Thread(()->{
            System.out.println("C");
        });

        for(int i=0;i<10;i++){
            thread1.start(); thread1.join();
            thread2.start(); thread2.join();
            thread3.start(); thread3.join();



        }
    }
}
